package com.example.exercise.websocket;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class InitController {

    @Resource
    private MyWebSocket myWebSocket;

    @RequestMapping(value = "/sendToAll",method = {RequestMethod.GET})
    public void sendToAll(){
        myWebSocket.sendAll("mygod","1");
    }

}
